//节流
function throttle(func, wait) {
    let timeout = null;
    return function() {
        if(timeout) {
            return
        }
        timeout = setTimeout(() => {
            func()
        },wait)
    }
}
//拖拽事件
let div1 = document.querySelector('.div1')
//监听拖拽
div1.addEventListener('drag',throttle(function() {
    console.log('拖拽中')
},1000))